# 使用官方Nginx基础镜像
FROM nexus.hsop.site:18000/nginx:1.25.2-alpine

# 删除默认的Nginx配置文件
RUN rm /usr/share/nginx/html/*

# 复制本地的HTML文件到容器中
COPY ./dist/ /usr/share/nginx/html/

# 删除默认的Nginx配置文件
RUN rm /etc/nginx/conf.d/default.conf
# 复制本地的Nginx配置文件到容器中
COPY ./nginxconfig/default.conf /etc/nginx/conf.d/

# 暴露Nginx服务端口
EXPOSE 80

# 启动Nginx服务
CMD ["nginx", "-g", "daemon off;"]



# # 新
# # 指定使用最新版本的node基础镜像
# # FROM node:latest
# # FROM nexus.hsop.site:18000/node:18-alpine
# FROM node:16.9.1
# # 在容器内创建/home/www/express目录
# RUN mkdir -p /app/home/www/express
# # 将容器内工作目录设置为/home/www/express
# WORKDIR /app
# # 将宿主机当前目录下内容复制到镜像/home/www/express目录下
# COPY . .
# # npm install安装应用所需的NPM包
# # RUN npm cache clean --force
# # RUN yarn config set workspaces-experimental true
# # RUN yarn config set registry https://registry.npm.taobao.org
# # RUN yarn
# RUN npm install
# # 对外开放容器的3000端口
# EXPOSE 8013
# # 容器启动后执行的命令。不可被docker run提供的参数覆盖
# CMD ["npm", "run", "dev"]